package com.niiwoo.civet.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Description:
 * @Author:LiJian
 * @Date:2017/11/10
 */
@Getter
@AllArgsConstructor
public enum TianchengCallbackEventEnum {

    // 极速借授信/反欺诈
    SPEED_LOAN_CREDIT_FRAUD("speedLoanCreditFraud", "极速借授信反欺诈"),
    SPEED_LOAN_CREDIT("speedLoanCredit","极速借授信"),
    SPEED_LOAN_FAKE_FRAUD("loanFake","借款反欺诈"),
    SPEED_LOAN_RISK_RULE("riskRule","风险规则"),
    SPEED_LOAN_AUDIT_POINT_FAKE("auditPointFake","审核要点");

    private String eventType;
    private String eventDesc;

    public static TianchengCallbackEventEnum getByEventType(String eventType) {
        Optional<TianchengCallbackEventEnum> callbackEvent =
                Arrays.stream(values()).filter(value -> value.getEventType().equals(eventType)).findFirst();
        return callbackEvent.isPresent() ? callbackEvent.get() : null;
    }

}
